# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Solar.V1.Model.SavingsOverTime do
  @moduledoc """
  Financial information that's shared between different financing methods.

  ## Attributes

  *   `financiallyViable` (*type:* `boolean()`, *default:* `nil`) - Indicates whether this scenario is financially viable. Will be false for scenarios with poor financial viability (e.g., money-losing).
  *   `presentValueOfSavingsLifetime` (*type:* `GoogleApi.Solar.V1.Model.Money.t`, *default:* `nil`) - Using the assumed discount rate, what is the present value of the cumulative lifetime savings?
  *   `presentValueOfSavingsYear20` (*type:* `GoogleApi.Solar.V1.Model.Money.t`, *default:* `nil`) - Using the assumed discount rate, what is the present value of the cumulative 20-year savings?
  *   `savingsLifetime` (*type:* `GoogleApi.Solar.V1.Model.Money.t`, *default:* `nil`) - Savings in the entire panel lifetime.
  *   `savingsYear1` (*type:* `GoogleApi.Solar.V1.Model.Money.t`, *default:* `nil`) - Savings in the first year after panel installation.
  *   `savingsYear20` (*type:* `GoogleApi.Solar.V1.Model.Money.t`, *default:* `nil`) - Savings in the first twenty years after panel installation.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :financiallyViable => boolean() | nil,
          :presentValueOfSavingsLifetime => GoogleApi.Solar.V1.Model.Money.t() | nil,
          :presentValueOfSavingsYear20 => GoogleApi.Solar.V1.Model.Money.t() | nil,
          :savingsLifetime => GoogleApi.Solar.V1.Model.Money.t() | nil,
          :savingsYear1 => GoogleApi.Solar.V1.Model.Money.t() | nil,
          :savingsYear20 => GoogleApi.Solar.V1.Model.Money.t() | nil
        }

  field(:financiallyViable)
  field(:presentValueOfSavingsLifetime, as: GoogleApi.Solar.V1.Model.Money)
  field(:presentValueOfSavingsYear20, as: GoogleApi.Solar.V1.Model.Money)
  field(:savingsLifetime, as: GoogleApi.Solar.V1.Model.Money)
  field(:savingsYear1, as: GoogleApi.Solar.V1.Model.Money)
  field(:savingsYear20, as: GoogleApi.Solar.V1.Model.Money)
end

defimpl Poison.Decoder, for: GoogleApi.Solar.V1.Model.SavingsOverTime do
  def decode(value, options) do
    GoogleApi.Solar.V1.Model.SavingsOverTime.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Solar.V1.Model.SavingsOverTime do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
